package com.jiangjiang.eshop.promotion.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiangjiang.eshop.promotion.dao.CouponMapper;
import com.jiangjiang.eshop.promotion.domain.CouponEntity;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;

/**
 * @ClassName CouponService
 * @Description TODO
 * @Author jhw
 * @Date 2021/7/22 10:59
 * @Version 1.0
 **/
@Service
public class CouponService extends ServiceImpl<CouponMapper, CouponEntity> {

    /**
     * 根据优惠券id集合查询优惠券
     * @param couponIdSet id集合
     * @return 查询结果
     */
    public List<CouponEntity> queryByIds(Set<Long> couponIdSet) {
        LambdaQueryWrapper<CouponEntity> wrapper = Wrappers.lambdaQuery();
        wrapper.in(CouponEntity::getId, couponIdSet);
        return this.list(wrapper);
    }

}
